

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-tab layui-tab-brief" lay-filter="tabBrief">
            <div style="padding: 15px 15px 5px 15px;">
                <button class="layui-btn layuiadmin-btn-ads" data-type="add">添加</button>
            </div>

            <ul class="layui-tab-title">
                <li class="layui-this">启动页广告</li>
                <li>首页轮播广告</li>
                <li>首页弹窗广告</li>
                <li>短视频广告</li>
                <li>动态列表广告</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <table id="LAY-ads-applaunch-manage" lay-filter="LAY-ads-applaunch-manage"></table>
                </div>
                <div class="layui-tab-item">
                    <table id="LAY-ads-apphome-manage" lay-filter="LAY-ads-apphome-manage"></table>
                </div>
                <div class="layui-tab-item">
                    <table id="LAY-ads-apphomepop-manage" lay-filter="LAY-ads-apphomepop-manage"></table>
                </div>
                <div class="layui-tab-item">
                    <table id="LAY-ads-svideo-manage" lay-filter="LAY-ads-svideo-manage"></table>
                </div>
                <div class="layui-tab-item">
                    <table id="LAY-ads-appmoments-manage" lay-filter="LAY-ads-appmoments-manage"></table>
                </div>
            </div>

            <script type="text/html" id="table-adslist-ads">
                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon"></i>编辑</a>
                {{#  if(d.status == 0){ }}
                <a class="layui-btn layui-btn-xs" lay-event="opt"><i class="layui-icon"></i>生效</a>
                {{#  } else { }}
                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="opt"><i class="layui-icon"></i>失效</a>
                {{#  } }}
                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon"></i>删除</a>
            </script>
        </div>
    </div>
</div>

<script src="/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'ads'], function () {
        var $ = layui.$
            ,form = layui.form
            ,table = layui.table;

        //事件
        var active = {
            add: function(){
                layer.open({
                    type: 2
                    ,title: '添加广告'
                    ,content: '/admin/ads/appadd'
                    ,maxmin: true
                    ,area: ['650px', '450px']
                });
            }
        };

        $('.layui-btn.layuiadmin-btn-ads').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    });
</script>
</body>
</html>
